package net.stogi.unicore.beyond.ui.client.taskeditor.taskpreview;

import net.stogi.unicore.beyond.api.model.InputType;

import com.google.gwt.event.shared.GwtEvent;

public class AddInputDefinitionEvent extends GwtEvent<AddInputDefinitionHandler> {

	public static final GwtEvent.Type<AddInputDefinitionHandler> TYPE = new GwtEvent.Type<AddInputDefinitionHandler>();

	private InputType inputType;

	public AddInputDefinitionEvent(InputType inputType) {
		this.inputType = inputType;
	}
	
	@SuppressWarnings("unused")
	private AddInputDefinitionEvent() {}

	@Override
	public Type<AddInputDefinitionHandler> getAssociatedType() {
		return TYPE;
	}

	/**
	 * @return the inputType
	 */
	public InputType getInputType() {
		return inputType;
	}

	/**
	 * @param inputType the inputType to set
	 */
	public void setInputType(InputType inputType) {
		this.inputType = inputType;
	}

	@Override
	protected void dispatch(AddInputDefinitionHandler handler) {
		handler.onAddInputDefinition(this);
	}
}
